﻿export default url => {
    const crud = window.$crud(url)

    // 新增回款记录
    const addRecord = (data) => window.$axios({
        url: `erpCase/customergatherdetail`,
        method: 'post',
        data:data
    })

    // 更新回款记录
    const putRecord = (id,data) => window.$axios({
        url: `erpCase/customergatherdetail/${id}`,
        method: 'put',
        data:data
    })
    // 删除回款记录
    const deleteRecord = (id) => window.$axios({
        url: `erpCase/customergatherdetail/${id}`,
        method: 'delete',
    })
    
    // 获取回款记录
    const getRecordPage = (data) => window.$axios({
        url: `erpCase/customergatherdetail/page`,
        method: 'get',
        params:data,
    })

    const getRecord = (id) => window.$axios({
        url: `erpCase/customergatherdetail/${id}`,
        method: 'get'
    })

    return {
        ...crud,
        addRecord,
        putRecord,
        deleteRecord,
        getRecord,
        getRecordPage
    }
}